<?php
/**
 * Created by 沧月
 * User: Lhhhh丶
 * Date: 2019/4/29
 * Time: 0:15
 */

namespace app\api\controller\v1;

use app\api\model\Category as CategoryModel;
use app\lib\exception\CategoryException;

class Category
{
    public function getAllCategories(){
        $catetories = CategoryModel::all([],'img');
        if($catetories->isEmpty()){
            throw new CategoryException();
        }
        return $catetories;
    }
}